package system.student.funtion.exhibition.adminfunction.impl;

import system.student.entity.TrainingBudget;
import system.student.entity.TrainingPlan;
import system.student.funtion.exhibition.adminfunction.TrainingPlanService;
import system.student.mapper.TrainingPlanMapper;
import system.student.util.MapperUtil;

import java.util.List;

public class trainingPlanServiceImpl implements TrainingPlanService {

    public static final TrainingPlanMapper trainingPlanMapper = MapperUtil.getMapper(TrainingPlanMapper .class);

    /**
     * 添加培养计划
     * @param trainingPlan
     */
    @Override
    public void addTrainingPlan(TrainingPlan trainingPlan) {
        trainingPlanMapper.addTrainingPlan(trainingPlan);
    }

    /**
     * 查询所有培养计划
     * @return
     */
    @Override
    public List<TrainingPlan> findAllTrainingPlan() {
        List<TrainingPlan> trainingPlanList= trainingPlanMapper.findAllTrainingPlan();
        return trainingPlanList;
    }

    /**
     * 删除培养计划
     * @param trainingPlanId
     */
    @Override
    public void deleteTrainingPlan(Long trainingPlanId) {
        trainingPlanMapper.deleteTrainingPlan(trainingPlanId);
    }

    /**
     * 添加培养预算
     * @param trainingBudget
     */
    @Override
    public void addTrainingBudget(TrainingBudget trainingBudget) {
        trainingPlanMapper.addTrainingBudget(trainingBudget);
    }

    /**
     * 查询所有培养预算
     * @return
     */
    @Override
    public List<TrainingBudget> findAllTrainingBudget() {
        List<TrainingBudget> trainingBudgetList=trainingPlanMapper.findAllTrainingBudget();
        return trainingBudgetList;
    }

    @Override
    public void deleteTrainingBudget(long planId) {
        trainingPlanMapper.deleteTrainingBudget(planId);
    }
}
